/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.menosehmais.framework.configuration;

import br.com.caelum.vraptor.ComponentRegistry;
import br.com.caelum.vraptor.ioc.spring.SpringProvider;
import br.com.caelum.vraptor.util.jpa.EntityManagerCreator;
//import br.com.caelum.vraptor.util.jpa.EntityManagerFactoryCreator;
import br.com.caelum.vraptor.util.jpa.JPATransactionInterceptor;

/**
 * @author Quintino
 */
public class CustomProvider extends SpringProvider {

    @Override
    protected void registerCustomComponents(ComponentRegistry registry) {
        registry.register(EntityManagerCreator.class,
                          EntityManagerCreator.class); // cria EntityManager's
        //registry.register(EntityManagerFactoryCreator.class,
        //                  CustomEntityManagerFactoryCreator.class); //cria uma EntityManagerFactory
        registry.register(JPATransactionInterceptor.class,
                          JPATransactionInterceptor.class); //open EntityManager and transaction in view
    }
}
